layui.use(['form', 'layer', 'laydate'], function () {

    var $ = layui.$
        , form = layui.form
        , laydate = layui.laydate;

    form.verify({
        uppercase: function (value, item) {
            if (!/^[A-Z]{2}$/.test(value)) {
                return '请输入两个大写字母';
            }
        }
    });

    // 最大可售卖数量校验
    form.verify({
        gtZero: function(value, item){
            if(value <= 0){
                return '请输入大于0的数字';
            }
        }
    });

    // 监听航司的编号，展示产品类型
    //输入框的值改变时触发
    $("#AirLine").on("input", function (e) {
        let airLine = $('#AirLine').val();
        $("#AirLine2").val(airLine);
    });

    //起飞到达
    $("#depart_code").on("input", function (e) {
        let depart_code = $('#depart_code').val();
        $("#arrived_code2").val(depart_code);
    });
    $("#arrived_code").on("input", function (e) {
        let depart_code = $('#arrived_code').val();
        $("#depart_code2").val(depart_code);
    });

    //航班号限制
    form.on('select(flightNoLimit)', function (data) {
        var FlightLimitConditionDiv = $('#FlightLimitConditionDiv');
        if (data.value == '适用' || data.value == '不适用') {
            FlightLimitConditionDiv.show();
        } else {
            FlightLimitConditionDiv.hide();
        }
        doCheckRequired(FlightLimitConditionDiv)
    });

    //航班号限制
    form.on('select(flightNoLimit2)', function (data) {
        var FlightLimitConditionDiv = $('#FlightLimitConditionDiv2');
        if (data.value == '适用' || data.value == '不适用') {
            FlightLimitConditionDiv.show();
        } else {
            FlightLimitConditionDiv.hide();
        }
        doCheckRequired(FlightLimitConditionDiv)
    });

    /**
     * 航班班期限制 全选
     */
    $('#flight-week-all').on('click', function () {

        $('input[name="dayCondition[]"]').each(function () {
            this.checked = true;
        });
        checkDay("dayCondition","DaysCheck","DaysFDiv");

        form.render('checkbox'); //刷新
    });

    /**
     * 航班班期限制 全选
     */
    $('#flight-week-all2').on('click', function () {

        $('input[name="dayCondition2[]"]').each(function () {
            this.checked = true;
        });
        checkDay("dayCondition2","DaysCheck2","DaysFDiv2");

        form.render('checkbox'); //刷新
    });

    /**
     * 航班班期限制 反选
     */
    $('#flight-week-invert').on('click', function () {

        $('input[name="dayCondition[]"]').each(function () {
            this.checked = !this.checked;
        });
        checkDay("dayCondition","DaysCheck","DaysFDiv");

        form.render('checkbox'); //刷新
    })

    /**
     * 航班班期限制 反选
     */
    $('#flight-week-invert2').on('click', function () {

        $('input[name="dayCondition2[]"]').each(function () {
            this.checked = !this.checked;
        });
        checkDay("dayCondition2","DaysCheck2","DaysFDiv2");

        form.render('checkbox'); //刷新
    })

    //监听航班班期限制
    form.on('checkbox(dayCondition)', function (data) {
        checkDay("dayCondition","DaysCheck","DaysFDiv");
    });

    //监听航班班期限制
    form.on('checkbox(dayCondition2)', function (data) {
        checkDay("dayCondition","DaysCheck2","DaysFDiv2");
    });

    var checkDay = function checkDays(dayCondition,DaysCheck,DaysFDiv) {
        let divEle = $('#'+DaysFDiv);
        let checkbox = divEle.find('input[type="checkbox"][name="'+dayCondition+'[]"]');
        let checkedCount = checkbox.filter(':checked').length;
        let newDivEle = divEle.get(0);
        if (checkedCount == 0) {
            $('#'+DaysCheck).show();
            newDivEle.setAttribute("lay-verify", "required");
        } else {
            $('#'+DaysCheck).hide();
            newDivEle.setAttribute("lay-verify", "");
        }
    }
    checkDay("dayCondition","DaysCheck","DaysFDiv");
    checkDay("dayCondition2","DaysCheck2","DaysFDiv2");

    //有效起飞航班日期
    laydate.render({
        elem: '#flight-date'
        , type: 'date'
        , range: ['#flight-start', '#flight-end']
        , rangeLinked: true // 是否开启日期范围选择时的区间联动标注模式
        // ,value: ['2022-05-01', '2022-06-01']
    });

    //销售日期
    laydate.render({
        elem: '#sale-date'
        , type: 'date'
        , range: ['#sale-start', '#sale-end']
        , rangeLinked: true // 是否开启日期范围选择时的区间联动标注模式
        //,value: ['2022-05-01', '2022-06-01']
    });

    //禁止销售日期
    laydate.render({
        elem: '#stop-sale-date'
        , type: 'date'
        , range: ['#stop-sale-start', '#stop-sale-end']
        , rangeLinked: true // 是否开启日期范围选择时的区间联动标注模式
        //,value: ['2022-05-01', '2022-06-01']
    });

    /**
     * 价格结算及校验
     */
    //变更选择运价类型时
    form.on('select(printsource)', function (data) {
        function initPriceRule(priceRuleValue) {
            $('#XCabinDiv').hide();
            $('#CabinSelPriceDiv').hide();
            $('#CalculationFaceValueDiv').show();
            $('#DesignationFaceValueDiv').hide();
            $('#FaceValueBackDiv').show();
            $('#FaceValueKeepDiv').show();
            $('#FaceValueIntDiv').show();
            $('#MinFaceValueDiv').show();
            $('#MaxFaceValueDiv').show();
            calculationFaceValueFuc('printComputeType',priceRuleValue,'DesignationFaceValueDiv','XCabinDiv','CabinSelPriceDiv2','FaceValueKeep','FaceValueBack','PriceRuleTip','CalculationFaceValueDiv','formula','FaceValueBackDiv','FaceValueKeepDiv','FaceValueIntDiv','MinFaceValueDiv','MaxFaceValueDiv');
        }

        if (data.value == '公布运价') {
            $('#PriceRuleTip').show();
            $("#PriceRuleTip").html("FD运价；以平台运价为准");
            initPriceRule(data.value);
        } else if (data.value == '私有运价') {
            $('#PriceRuleTip').show();
            $("#PriceRuleTip").html("NFD运价，当NFD运价缺失时，取FD运价进行计算；以平台运价为准");
            initPriceRule(data.value);
        } else if (data.value == '直减运价') {
            $('#PriceRuleTip').show();
            $("#PriceRuleTip").html("直减运价，当直减运价缺失时，取NFD运价进行计算，当NFD运价也缺失时，取FD运价进行计算；以平台运价为准");
            initPriceRule(data.value);
        } else if (data.value == '指定票面价') {
            calculationFaceValueFuc('printComputeType',data.value,'DesignationFaceValueDiv','XCabinDiv','CabinSelPriceDiv2','FaceValueKeep','FaceValueBack','PriceRuleTip','CalculationFaceValueDiv','formula','FaceValueBackDiv','FaceValueKeepDiv','FaceValueIntDiv','MinFaceValueDiv','MaxFaceValueDiv');
        } else if (data.value == '旗舰店价格') {
            calculationFaceValueFuc('printComputeType',data.value,'DesignationFaceValueDiv','XCabinDiv','CabinSelPriceDiv2','FaceValueKeep','FaceValueBack','PriceRuleTip','CalculationFaceValueDiv','formula','FaceValueBackDiv','FaceValueKeepDiv','FaceValueIntDiv','MinFaceValueDiv','MaxFaceValueDiv');
        }
    });

    /**
     * 价格结算及校验
     */
    //变更选择运价类型时
    form.on('select(printsource2)', function (data) {
        function initPriceRule(priceRuleValue) {
            $('#XCabinDiv2').hide();
            $('#CabinSelPriceDiv2').hide();
            $('#CalculationFaceValueDiv2').show();
            $('#DesignationFaceValueDiv2').hide();
            $('#FaceValueBackDiv2').show();
            $('#FaceValueKeepDiv2').show();
            $('#FaceValueIntDiv2').show();
            $('#MinFaceValueDiv2').show();
            $('#MaxFaceValueDiv2').show();
            calculationFaceValueFuc('printComputeType2',priceRuleValue,'DesignationFaceValueDiv2','XCabinDiv2','CabinSelPriceDiv2','FaceValueKeep2','FaceValueBack2','PriceRuleTip2','CalculationFaceValueDiv2','formula2','FaceValueBackDiv2','FaceValueKeepDiv2','FaceValueIntDiv2','MinFaceValueDiv2','MaxFaceValueDiv2');
        }

        if (data.value == '公布运价') {
            $('#PriceRuleTip2').show();
            $("#PriceRuleTip2").html("FD运价；以平台运价为准");
            initPriceRule(data.value);
        } else if (data.value == '私有运价') {
            $('#PriceRuleTip2').show();
            $("#PriceRuleTip2").html("NFD运价，当NFD运价缺失时，取FD运价进行计算；以平台运价为准");
            initPriceRule(data.value);
        } else if (data.value == '直减运价') {
            $('#PriceRuleTip2').show();
            $("#PriceRuleTip2").html("直减运价，当直减运价缺失时，取NFD运价进行计算，当NFD运价也缺失时，取FD运价进行计算；以平台运价为准");
            initPriceRule(data.value);
        } else if (data.value == '指定票面价') {
            calculationFaceValueFuc('printComputeType2',data.value,'DesignationFaceValueDiv2','XCabinDiv2','CabinSelPriceDiv2','FaceValueKeep2','FaceValueBack2','PriceRuleTip2','CalculationFaceValueDiv2','formula2','FaceValueBackDiv2','FaceValueKeepDiv2','FaceValueIntDiv2','MinFaceValueDiv2','MaxFaceValueDiv2');
        } else if (data.value == '旗舰店价格') {
            calculationFaceValueFuc('printComputeType2',data.value,'DesignationFaceValueDiv2','XCabinDiv2','CabinSelPriceDiv2','FaceValueKeep2','FaceValueBack2','PriceRuleTip2','CalculationFaceValueDiv2','formula2','FaceValueBackDiv2','FaceValueKeepDiv2','FaceValueIntDiv2','MinFaceValueDiv2','MaxFaceValueDiv2');
        }
    });

    var doCheckRequired = function checkRequired(checkDiv) {
        let divEle = checkDiv.get(0);
        let DivStyle = divEle.getAttribute("style");
        let input = divEle.querySelector("input[type='text']");
        if (DivStyle != null && DivStyle != "") {
            if (DivStyle == 'display: none;') {
                input.setAttribute("lay-verify", "")
            } else {
                input.setAttribute("lay-verify", "required")
            }
        } else {
            input.setAttribute("lay-verify", "required")
        }
    }

    //变更公式计算票面价类型
    form.on('select(printComputeType)', function (data) {
        let calculationFaceSelValue = data.value;
        let priceRuleValue = $('select[name="printsource"] option:selected').val();
        doCalculationFaceValueFuc(priceRuleValue, calculationFaceSelValue,'DesignationFaceValueDiv','XCabinDiv','CabinSelPriceDiv2','FaceValueKeep','FaceValueBack','PriceRuleTip','CalculationFaceValueDiv','formula','FaceValueBackDiv','FaceValueKeepDiv','FaceValueIntDiv','MinFaceValueDiv','MaxFaceValueDiv');
    });

    //变更公式计算票面价类型2
    form.on('select(printComputeType2)', function (data) {
        let calculationFaceSelValue = data.value;
        let priceRuleValue = $('select[name="printsource2"] option:selected').val();
        doCalculationFaceValueFuc(priceRuleValue, calculationFaceSelValue,'DesignationFaceValueDiv2','XCabinDiv2','CabinSelPriceDiv2','FaceValueKeep2','FaceValueBack2','PriceRuleTip2','CalculationFaceValueDiv2','formula2','FaceValueBackDiv2','FaceValueKeepDiv2','FaceValueIntDiv2','MinFaceValueDiv2','MaxFaceValueDiv2');
    });

    //选择运价类型时,根据公式计算票面价类型展示div
    var calculationFaceValueFuc = function (printComputeType,priceRuleValue,DesignationFaceValueDiv,XCabinDiv,CabinSelPriceDiv,FaceValueKeep,FaceValueBack,PriceRuleTip,CalculationFaceValueDiv,formula,FaceValueBackDiv,FaceValueKeepDiv,FaceValueIntDiv,MinFaceValueDiv,MaxFaceValueDiv){
        let calculationFaceSelValue = $('select[name="'+printComputeType+'"] option:selected').val();
        doCalculationFaceValueFuc(priceRuleValue, calculationFaceSelValue,DesignationFaceValueDiv,XCabinDiv,CabinSelPriceDiv,FaceValueKeep,FaceValueBack,PriceRuleTip,CalculationFaceValueDiv,formula,FaceValueBackDiv,FaceValueKeepDiv,FaceValueIntDiv,MinFaceValueDiv,MaxFaceValueDiv);
    }

    let priceRuleValue = $('select[name="printsource"] option:selected').val();
    calculationFaceValueFuc('printComputeType',priceRuleValue,'DesignationFaceValueDiv','XCabinDiv','CabinSelPriceDiv','FaceValueKeep','FaceValueBack','PriceRuleTip','CalculationFaceValueDiv','formula','FaceValueBackDiv','FaceValueKeepDiv','FaceValueIntDiv','MinFaceValueDiv','MaxFaceValueDiv');

    let priceRuleValue2 = $('select[name="printsource2"] option:selected').val();
    calculationFaceValueFuc('printComputeType2',priceRuleValue2,'DesignationFaceValueDiv2','XCabinDiv2','CabinSelPriceDiv2','FaceValueKeep2','FaceValueBack2','PriceRuleTip2','CalculationFaceValueDiv2','formula2','FaceValueBackDiv2','FaceValueKeepDiv2','FaceValueIntDiv2','MinFaceValueDiv2','MaxFaceValueDiv2');

    // 选择运价类型时,根据公式计算票面价类型展示div
    function doCalculationFaceValueFuc(priceRuleValue, calculationFaceSelValue,
                                       DesignationFaceValueDivId,XCabinDivId,CabinSelPriceDivId,FaceValueKeep,
                                       FaceValueBack,PriceRuleTip,CalculationFaceValueDiv,formula,
                                       FaceValueBackDiv,FaceValueKeepDiv,FaceValueIntDiv,MinFaceValueDiv,MaxFaceValueDiv) {
        var DesignationFaceValueDiv = $('#'+DesignationFaceValueDivId);
        var XCabinDiv = $('#'+XCabinDivId);
        var CabinSelPriceDiv = $('#'+CabinSelPriceDivId);
        let faceValueKeep = document.getElementById(FaceValueKeep);
        let faceValueBack = document.getElementById(FaceValueBack);

        function initDesignationPriceRule() {
            $('#'+PriceRuleTip).hide();
            $('#'+CalculationFaceValueDiv).hide();
            XCabinDiv.hide();
            CabinSelPriceDiv.hide();
        }

        if (priceRuleValue == '公布运价' || priceRuleValue == '直减运价') {
            if (calculationFaceSelValue == '公式计算票面价(适用舱位)') {
                $("#"+formula).html("Y*(1-a)+b,其中Y、a、b分别为计算票面价的适用舱位、票面价返点和票面价留钱");
                XCabinDiv.hide();
                CabinSelPriceDiv.hide();
                faceValueBack.disabled = true;
                faceValueKeep.disabled = true;
            } else {
                $("#"+formula).html("X*(1-a)+b,其中X、a、b分别为计算票面价的基准舱位、票面价返点和票面价留钱");
                XCabinDiv.show();
                CabinSelPriceDiv.hide();
                faceValueBack.disabled = false;
                faceValueKeep.disabled = false;
            }
        } else if (priceRuleValue == '私有运价') {
            if (calculationFaceSelValue == '公式计算票面价(适用舱位)') {
                $("#"+formula).html("Y*(1-a)+b,其中Y、a、b分别为计算票面价的适用舱位、票面价返点和票面价留钱");
                XCabinDiv.hide();
                CabinSelPriceDiv.show();
                faceValueBack.disabled = true;
                faceValueKeep.disabled = true;
            } else {
                $("#"+formula).html("X*(1-a)+b,其中X、a、b分别为计算票面价的基准舱位、票面价返点和票面价留钱");
                XCabinDiv.show();
                CabinSelPriceDiv.show();
                faceValueBack.disabled = false;
                faceValueKeep.disabled = false;
            }
        } else if (priceRuleValue == '指定票面价') {
            initDesignationPriceRule();
            $('#'+FaceValueBackDiv).hide();
            $('#'+FaceValueKeepDiv).hide();
            $('#'+FaceValueIntDiv).hide();
            $('#'+MinFaceValueDiv).hide();
            $('#'+MaxFaceValueDiv).hide();
            // 指定票面价层显示
            DesignationFaceValueDiv.show();
        } else if (priceRuleValue == '旗舰店价格') {
            initDesignationPriceRule();
            $('#'+FaceValueBackDiv).show();
            $('#'+FaceValueKeepDiv).show();
            $('#'+FaceValueIntDiv).show();
            $('#'+MinFaceValueDiv).show();
            $('#'+MaxFaceValueDiv).show();
            DesignationFaceValueDiv.hide();
        }

        doCheckRequired(DesignationFaceValueDiv);
        doCheckRequired(XCabinDiv);
        doCheckRequired(CabinSelPriceDiv);
    }

    let endorsementHtml = "签转条件：不可签转";
    //监听 是否允许签转
    $('#endorsementDiv').on('click', function () {
        let endorsement = $('#endorsement').click();
        if (endorsement.get(0).checked) {
            endorsement.next('div').addClass('layui-form-checked');
        } else {
            endorsement.next('div').removeClass('layui-form-checked');
        }
        endorsementCheck('endorsement');
        returnChange('ReturnChangeText');
    })

    //监听 是否允许签转
    $('#endorsementDiv2').on('click', function () {
        let endorsement = $('#endorsement2').click();
        if (endorsement.get(0).checked) {
            endorsement.next('div').addClass('layui-form-checked');
        } else {
            endorsement.next('div').removeClass('layui-form-checked');
        }
        endorsementCheck('endorsement2');
        returnChange('ReturnChangeText2');
    })

    //监听 是否允许签转 checkbox
    form.on('checkbox(endorsement)', function () {
        endorsementCheck('endorsement');
        returnChange('ReturnChangeText');
    })
    //监听 是否允许签转 checkbox
    form.on('checkbox(endorsement2)', function () {
        endorsementCheck('endorsement2');
        returnChange('ReturnChangeText2');
    })

    // 是否允许签转 checkbox是否选中
    function endorsementCheck(endorsementId) {
        let endorsement = $('#'+endorsementId);
        if (endorsement.get(0).checked) {
            endorsementHtml = '签转条件：可签转';
        } else {
            endorsementHtml = '签转条件：不可签转';
        }
    }
    endorsementCheck('endorsement');
    endorsementCheck('endorsement2');

    // 退票相关
    var returnRuleOption = false;
    var returnHtml = "";
    function returnRuleInfo (returnRuleId) {
        returnRuleOption = true;
        let returnRule = $('#'+returnRuleId).val();
        if (returnRule == '') {
            if (returnRuleOption) {
                returnHtml = "退票条件：无"
            } else {
                returnHtml = '';
            }
        } else {
            let parts = returnRule.split("-");
            if (parts.length != 3) {
                returnHtml = "退票编号错误";
            } else {
                let beforePercent = parts[0];
                let hour = parts[1];
                let afterPercent = parts[2];
                if (beforePercent == '' || hour == '' || afterPercent == '' || isNaN(beforePercent) || isNaN(hour) || isNaN(afterPercent)) {
                    returnHtml = "退票编号错误";
                } else {
                    returnHtml = '退票条件：航班起飞前' + hour + '小时之前（含），退票手续费为票面价的' + beforePercent + '%；航班起飞前' + hour + '小时之后（不含），退票手续费为票面价的' + afterPercent + '%';
                }
            }
        }
    }


    // 退票相关
    var returnRuleOption2 = false;
    var returnHtml2 = "";
    function returnRuleInfo2 (returnRuleId) {
        returnRuleOption2 = true;
        let returnRule = $('#'+returnRuleId).val();
        if (returnRule == '') {
            if (returnRuleOption) {
                returnHtml2 = "退票条件：无"
            } else {
                returnHtml2 = '';
            }
        } else {
            let parts = returnRule.split("-");
            if (parts.length != 3) {
                returnHtml = "退票编号错误";
            } else {
                let beforePercent = parts[0];
                let hour = parts[1];
                let afterPercent = parts[2];
                if (beforePercent == '' || hour == '' || afterPercent == '' || isNaN(beforePercent) || isNaN(hour) || isNaN(afterPercent)) {
                    returnHtml2 = "退票编号错误";
                } else {
                    returnHtml2 = '退票条件：航班起飞前' + hour + '小时之前（含），退票手续费为票面价的' + beforePercent + '%；航班起飞前' + hour + '小时之后（不含），退票手续费为票面价的' + afterPercent + '%';
                }
            }
        }
    }

    returnRuleInfo('returnRule');
    returnRuleInfo('returnRule2');

    // 退票 输入框失去焦点时
    $('#returnRule').blur(function () {
        returnRuleInfo('returnRule');
        returnChange('ReturnChangeText');
    });
    // 退票 输入框失去焦点时
    $('#returnRule2').blur(function () {
        returnRuleInfo('returnRule2');
        returnChange('ReturnChangeText2');
    });

    // 改签相关
    var changeRuleOption = false;
    let changeHtml = "";
    function changeRuleInfo (changeRuleId) {
        changeRuleOption = true;
        let changeRule = $('#'+changeRuleId).val();
        if (changeRule == '') {
            if (changeRuleOption) {
                changeHtml = "更改条件：无"
            } else {
                changeHtml = '';
            }
        } else {
            let parts = changeRule.split("-");
            if (parts.length != 3) {
                changeHtml = "改期编号错误";
            } else {
                let beforePercent = parts[0];
                let hour = parts[1];
                let afterPercent = parts[2];
                if (beforePercent == '' || hour == '' || afterPercent == '' || isNaN(beforePercent) || isNaN(hour) || isNaN(afterPercent)) {
                    changeHtml = "改期编号错误";
                } else {
                    changeHtml = '更改条件：航班起飞前' + hour + '小时之前（含），改期手续费为票面价的' + beforePercent + '%；航班起飞前' + hour + '小时之后（不含），改期手续费为票面价的' + afterPercent + '%';
                }
            }
        }
    }
    changeRuleInfo('changeRule');
    changeRuleInfo('changeRule2');

    // 改签 输入框失去焦点时
    $('#changeRule').blur(function () {
        changeRuleInfo('changeRule');
        returnChange('ReturnChangeText');
    });

    // 改签 输入框失去焦点时
    $('#changeRule2').blur(function () {
        changeRuleInfo('changeRule2');
        returnChange('ReturnChangeText2');
    });

    // 退改信息
    var returnChange = function (ReturnChangeText) {
        $('#'+ReturnChangeText).empty();

        let allHtml = returnHtml + '<br>' + changeHtml + '<br>' + endorsementHtml;

        $('#'+ReturnChangeText).get(0).innerHTML = allHtml;

    }
    returnChange('ReturnChangeText');
    returnChange('ReturnChangeText2');


    let highDemandTypeDiv = $('#highDemandTypeDiv');
    let officeNoDiv = $('#officeNoDiv');
    let highDemandThresholdDiv = $('#highDemandThresholdDiv');
    // 是否生成PNR
    var needPnr = function () {
        let value = $('input[type="radio"][name="needPnr"]:checked').val();
        highDemandThresholdDiv.hide();
        if (value == '是') {
            highDemandTypeDiv.hide();
            officeNoDiv.show();
        } else {
            highDemandTypeDiv.show();
            officeNoDiv.hide();
        }
    }
    needPnr();

    //监听 是否生成PNR
    form.on('radio(needPnr)', function () {
        needPnr();
    });

    // 紧俏座位处理
    function highDemandType() {
        let needPnrValue = $('input[type="radio"][name="needPnr"]:checked').val();
        if (needPnrValue == '否') {
            let value = $('input[type="radio"][name="highDemandType"]:checked').val();
            if (value == '不处理') {
                highDemandThresholdDiv.hide();
                officeNoDiv.hide();
            } else if (value == '生 PNR') {
                highDemandThresholdDiv.show();
                officeNoDiv.show();
            } else {
                highDemandThresholdDiv.show();
                officeNoDiv.hide();
            }
        }
    }
    highDemandType();

   //监听 紧俏座位处理
    form.on('radio(highDemandType)', function () {
        highDemandType();
    });

    // 舱位说明 Fun
    var checkCabin  = function checkCabinDec() {
        var currleg = $("#cabinNote").val().length;
        var length = $("#cabinNote").attr('maxlength');
        let remainLeg = length - currleg;
        $("#cabinDes").get(0).innerHTML = '剩余' + remainLeg + '字符';
    }
    checkCabin();

    //监听 舱位说明:
    $("#cabinNote").on("input", function (e) {
        checkCabin();
    });

})